<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" isELIgnored="false" language="java" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title></title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/pintuer.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/admin.css">
    <script src="${pageContext.request.contextPath}/js/jquery.js"></script>
    <script src="${pageContext.request.contextPath}/js/pintuer.js"></script>
</head>
<body>
<form method="post" action="${pageContext.request.contextPath}/" id="form1">
    <div class="panel admin-panel">
        <div class="panel-head"><strong class="icon-reorder">身份证管理</strong></div>
        <div class="padding border-bottom">
            <ul class="search">
                <li>
                    <button type="button"  class="button border-green" id="checkall"><span class="icon-check"></span>全选</button>
                    <a class="button border-yellow" href="${pageContext.request.contextPath}/appendIdcard.action"><span class="icon-plus"></span>添加身份证</a>
            </ul>
        </div>
        <table class="table table-hover text-center">
            <tr>
                <th width="120">编号</th>
                <th>姓名</th>
                <th>性别</th>
                <th>年龄</th>
                <th>身份证号</th>
                <th>开始时间</th>
                <th>到期时间</th>
                <th>操作</th>
            </tr>
            <c:forEach items="${cards}" var="cards" varStatus="st">
                <tr>
                    <td><input type="checkbox" id="checkbox" name="id" value="${cards.card_id}"/>${st.count}</td>
                    <td>${cards.employee.employee_name}</td>
                    <td>${cards.employee.employee_sex}</td>
                    <td>${cards.employee.employee_age}</td>
                    <td>${cards.card_num}</td>
                    <td>${cards.card_start_time}</td>
                    <td>${cards.card_end_time}</td>
                    <td><div class="button-group">
                        <a class="button border-red" href="javascript:void(0)" onclick="return del(${cards.card_id})"><span class="icon-trash-o"></span> 删除</a>
                        <a class="button border-main" href="${pageContext.request.contextPath}/jumpPage.action?userid=${cards.card_id}"><span class="icon-edit"></span> 修改</a>
                    </div></td>
                </tr>
            </c:forEach>
            <tr>
                <td colspan="8">
                    <div class="pagelist">
                        <a href="${pageContext.request.contextPath}/showAllCard?pageNum=1">首页</a>
                        <a href="${pageContext.request.contextPath}/showAllCard?pageNum=${pageInfo.pageNum==1?1:pageInfo.pageNum-1}">上一页</a>
                        <c:forEach begin="1" end="${pageInfo.pages}" step="1" var="numPage">
                            <a href="${pageContext.request.contextPath}/showAllCard?pageNum=${numPage}">${numPage}</a>
                        </c:forEach>
                        <a href="${pageContext.request.contextPath}/showAllCard?pageNum=${pageInfo.pageNum==pageInfo.pages?pageInfo.pages:pageInfo.pageNum+1}">下一页</a>
                        <a href="${pageContext.request.contextPath}/showAllCard?pageNum=${pageInfo.pages}">尾页</a>
                    </div>
                </td>
            </tr>
        </table>
    </div>
</form>
<script type="text/javascript">

    function del(id){
        if(confirm("您确定要删除这个身份证吗?")){
            window.location.href="${pageContext.request.contextPath}/removeIdcard.action?idcard_id="+id;
        }
    }

</script>
</body></html>
